home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-06-25 | 23.3 KB | 1,221 lines |
- head 5.28;
- branch 5.28.0;
- access;
- symbols
- RELEASE:5.28.0.15
- BETA:5.28.0.15
- UICSO:5.28.0
- VANILLA:5.28;
- locks; strict;
- comment @ * @;
-
-
- 5.28
- date 90.06.20.08.36.34; author paul; state Exp;
- branches
- 5.28.0.1;
- next ;
-
- 5.28.0.1
- date 90.06.20.09.44.03; author paul; state Exp;
- branches;
- next 5.28.0.2;
-
- 5.28.0.2
- date 90.10.13.19.14.17; author paul; state Exp;
- branches;
- next 5.28.0.3;
-
- 5.28.0.3
- date 90.10.25.20.18.09; author paul; state Exp;
- branches;
- next 5.28.0.4;
-
- 5.28.0.4
- date 90.11.02.00.19.43; author paul; state Exp;
- branches;
- next 5.28.0.5;
-
- 5.28.0.5
- date 90.11.26.20.38.16; author paul; state Exp;
- branches;
- next 5.28.0.6;
-
- 5.28.0.6
- date 91.01.19.19.26.02; author paul; state Exp;
- branches;
- next 5.28.0.7;
-
- 5.28.0.7
- date 91.02.17.05.23.36; author paul; state Exp;
- branches;
- next 5.28.0.8;
-
- 5.28.0.8
- date 91.03.04.21.48.23; author paul; state Exp;
- branches;
- next 5.28.0.9;
-
- 5.28.0.9
- date 91.03.16.17.35.28; author paul; state Exp;
- branches;
- next 5.28.0.10;
-
- 5.28.0.10
- date 91.04.02.23.22.52; author paul; state Exp;
- branches;
- next 5.28.0.11;
-
- 5.28.0.11
- date 91.04.05.14.55.15; author paul; state Exp;
- branches;
- next 5.28.0.12;
-
- 5.28.0.12
- date 91.05.18.18.23.54; author paul; state Exp;
- branches;
- next 5.28.0.13;
-
- 5.28.0.13
- date 91.06.06.19.50.49; author paul; state Exp;
- branches;
- next 5.28.0.14;
-
- 5.28.0.14
- date 91.06.13.20.18.34; author paul; state Exp;
- branches;
- next 5.28.0.15;
-
- 5.28.0.15
- date 91.06.24.20.27.06; author paul; state Exp;
- branches;
- next ;
-
-
- desc
- @@
-
-
- 5.28
- log
- @5.64 Berkeley release
- @
- text
- @/*
- * Copyright (c) 1983 Eric P. Allman
- * Copyright (c) 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted provided
- * that: (1) source distributions retain this entire copyright notice and
- * comment, and (2) distributions including binaries display the following
- * acknowledgement: ``This product includes software developed by the
- * University of California, Berkeley and its contributors'' in the
- * documentation or other materials provided with the distribution and in
- * all advertising materials mentioning features or use of this software.
- * Neither the name of the University nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
- # include "sendmail.h"
-
- #ifndef lint
- #ifdef SMTP
- static char sccsid[] = "@@(#)srvrsmtp.c 5.28 (Berkeley) 6/1/90 (with SMTP)";
- #else
- static char sccsid[] = "@@(#)srvrsmtp.c 5.28 (Berkeley) 6/1/90 (without SMTP)";
- #endif
- #endif /* not lint */
-
- # include <errno.h>
- # include <signal.h>
-
- # ifdef SMTP
-
- /*
- ** SMTP -- run the SMTP protocol.
- **
- ** Parameters:
- ** none.
- **
- ** Returns:
- ** never.
- **
- ** Side Effects:
- ** Reads commands from the input channel and processes
- ** them.
- */
-
- struct cmd
- {
- char *cmdname; /* command name */
- int cmdcode; /* internal code, see below */
- };
-
- /* values for cmdcode */
- # define CMDERROR 0 /* bad command */
- # define CMDMAIL 1 /* mail -- designate sender */
- # define CMDRCPT 2 /* rcpt -- designate recipient */
- # define CMDDATA 3 /* data -- send message text */
- # define CMDRSET 4 /* rset -- reset state */
- # define CMDVRFY 5 /* vrfy -- verify address */
- # define CMDHELP 6 /* help -- give usage info */
- # define CMDNOOP 7 /* noop -- do nothing */
- # define CMDQUIT 8 /* quit -- close connection and die */
- # define CMDHELO 9 /* helo -- be polite */
- # define CMDONEX 10 /* onex -- sending one transaction only */
- # define CMDVERB 11 /* verb -- go into verbose mode */
- /* debugging-only commands, only enabled if SMTPDEBUG is defined */
- # define CMDDBGQSHOW 12 /* showq -- show send queue */
- # define CMDDBGDEBUG 13 /* debug -- set debug mode */
-
- static struct cmd CmdTab[] =
- {
- "mail", CMDMAIL,
- "rcpt", CMDRCPT,
- "data", CMDDATA,
- "rset", CMDRSET,
- "vrfy", CMDVRFY,
- "expn", CMDVRFY,
- "help", CMDHELP,
- "noop", CMDNOOP,
- "quit", CMDQUIT,
- "helo", CMDHELO,
- "verb", CMDVERB,
- "onex", CMDONEX,
- /*
- * remaining commands are here only
- * to trap and log attempts to use them
- */
- "showq", CMDDBGQSHOW,
- "debug", CMDDBGDEBUG,
- NULL, CMDERROR,
- };
-
- bool InChild = FALSE; /* true if running in a subprocess */
- bool OneXact = FALSE; /* one xaction only this run */
-
- #define EX_QUIT 22 /* special code for QUIT command */
-
- smtp()
- {
- register char *p;
- register struct cmd *c;
- char *cmd;
- extern char *skipword();
- bool hasmail; /* mail command received */
- auto ADDRESS *vrfyqueue;
- ADDRESS *a;
- char *sendinghost;
- char inp[MAXLINE];
- char cmdbuf[100];
- extern char Version[];
- extern char *macvalue();
- extern ADDRESS *recipient();
- extern ENVELOPE BlankEnvelope;
- extern ENVELOPE *newenvelope();
-
- hasmail = FALSE;
- if (OutChannel != stdout)
- {
- /* arrange for debugging output to go to remote host */
- (void) close(1);
- (void) dup(fileno(OutChannel));
- }
- settime();
- if (RealHostName != NULL)
- {
- CurHostName = RealHostName;
- setproctitle("srvrsmtp %s", CurHostName);
- }
- else
- {
- /* this must be us!! */
- CurHostName = MyHostName;
- }
- expand("\001e", inp, &inp[sizeof inp], CurEnv);
- message("220", inp);
- SmtpPhase = "startup";
- sendinghost = NULL;
- for (;;)
- {
- /* arrange for backout */
- if (setjmp(TopFrame) > 0 && InChild)
- finis();
- QuickAbort = FALSE;
- HoldErrs = FALSE;
-
- /* setup for the read */
- CurEnv->e_to = NULL;
- Errors = 0;
- (void) fflush(stdout);
-
- /* read the input line */
- p = sfgets(inp, sizeof inp, InChannel);
-
- /* handle errors */
- if (p == NULL)
- {
- /* end of file, just die */
- message("421", "%s Lost input channel from %s",
- MyHostName, CurHostName);
- finis();
- }
-
- /* clean up end of line */
- fixcrlf(inp, TRUE);
-
- /* echo command to transcript */
- if (CurEnv->e_xfp != NULL)
- fprintf(CurEnv->e_xfp, "<<< %s\n", inp);
-
- /* break off command */
- for (p = inp; isspace(*p); p++)
- continue;
- cmd = p;
- for (cmd = cmdbuf; *p != '\0' && !isspace(*p); )
- *cmd++ = *p++;
- *cmd = '\0';
-
- /* throw away leading whitespace */
- while (isspace(*p))
- p++;
-
- /* decode command */
- for (c = CmdTab; c->cmdname != NULL; c++)
- {
- if (!strcasecmp(c->cmdname, cmdbuf))
- break;
- }
-
- /* process command */
- switch (c->cmdcode)
- {
- case CMDHELO: /* hello -- introduce yourself */
- SmtpPhase = "HELO";
- setproctitle("%s: %s", CurHostName, inp);
- if (!strcasecmp(p, MyHostName))
- {
- /*
- * didn't know about alias,
- * or connected to an echo server
- */
- message("553", "Local configuration error, hostname not recognized as local");
- break;
- }
- if (RealHostName != NULL && strcasecmp(p, RealHostName))
- {
- char hostbuf[MAXNAME];
-
- (void) sprintf(hostbuf, "%s (%s)", p, RealHostName);
- sendinghost = newstr(hostbuf);
- }
- else
- sendinghost = newstr(p);
- message("250", "%s Hello %s, pleased to meet you",
- MyHostName, sendinghost);
- break;
-
- case CMDMAIL: /* mail -- designate sender */
- SmtpPhase = "MAIL";
-
- /* force a sending host even if no HELO given */
- if (RealHostName != NULL && macvalue('s', CurEnv) == NULL)
- sendinghost = RealHostName;
-
- /* check for validity of this command */
- if (hasmail)
- {
- message("503", "Sender already specified");
- break;
- }
- if (InChild)
- {
- errno = 0;
- syserr("Nested MAIL command");
- exit(0);
- }
-
- /* fork a subprocess to process this command */
- if (runinchild("SMTP-MAIL") > 0)
- break;
- define('s', sendinghost, CurEnv);
- define('r', "SMTP", CurEnv);
- initsys();
- setproctitle("%s %s: %s", CurEnv->e_id,
- CurHostName, inp);
-
- /* child -- go do the processing */
- p = skipword(p, "from");
- if (p == NULL)
- break;
- setsender(p);
- if (Errors == 0)
- {
- message("250", "Sender ok");
- hasmail = TRUE;
- }
- else if (InChild)
- finis();
- break;
-
- case CMDRCPT: /* rcpt -- designate recipient */
- SmtpPhase = "RCPT";
- setproctitle("%s %s: %s", CurEnv->e_id,
- CurHostName, inp);
- if (setjmp(TopFrame) > 0)
- {
- CurEnv->e_flags &= ~EF_FATALERRS;
- break;
- }
- QuickAbort = TRUE;
- p = skipword(p, "to");
- if (p == NULL)
- break;
- a = parseaddr(p, (ADDRESS *) NULL, 1, '\0');
- if (a == NULL)
- break;
- a->q_flags |= QPRIMARY;
- a = recipient(a, &CurEnv->e_sendqueue);
- if (Errors != 0)
- break;
-
- /* no errors during parsing, but might be a duplicate */
- CurEnv->e_to = p;
- if (!bitset(QBADADDR, a->q_flags))
- message("250", "Recipient ok");
- else
- {
- /* punt -- should keep message in ADDRESS.... */
- message("550", "Addressee unknown");
- }
- CurEnv->e_to = NULL;
- break;
-
- case CMDDATA: /* data -- text of mail */
- SmtpPhase = "DATA";
- if (!hasmail)
- {
- message("503", "Need MAIL command");
- break;
- }
- else if (CurEnv->e_nrcpts <= 0)
- {
- message("503", "Need RCPT (recipient)");
- break;
- }
-
- /* collect the text of the message */
- SmtpPhase = "collect";
- setproctitle("%s %s: %s", CurEnv->e_id,
- CurHostName, inp);
- collect(TRUE);
- if (Errors != 0)
- break;
-
- /*
- ** Arrange to send to everyone.
- ** If sending to multiple people, mail back
- ** errors rather than reporting directly.
- ** In any case, don't mail back errors for
- ** anything that has happened up to
- ** now (the other end will do this).
- ** Truncate our transcript -- the mail has gotten
- ** to us successfully, and if we have
- ** to mail this back, it will be easier
- ** on the reader.
- ** Then send to everyone.
- ** Finally give a reply code. If an error has
- ** already been given, don't mail a
- ** message back.
- ** We goose error returns by clearing error bit.
- */
-
- SmtpPhase = "delivery";
- if (CurEnv->e_nrcpts != 1)
- {
- HoldErrs = TRUE;
- ErrorMode = EM_MAIL;
- }
- CurEnv->e_flags &= ~EF_FATALERRS;
- CurEnv->e_xfp = freopen(queuename(CurEnv, 'x'), "w", CurEnv->e_xfp);
-
- /* send to all recipients */
- sendall(CurEnv, SM_DEFAULT);
- CurEnv->e_to = NULL;
-
- /* save statistics */
- markstats(CurEnv, (ADDRESS *) NULL);
-
- /* issue success if appropriate and reset */
- if (Errors == 0 || HoldErrs)
- message("250", "Ok");
- else
- CurEnv->e_flags &= ~EF_FATALERRS;
-
- /* if in a child, pop back to our parent */
- if (InChild)
- finis();
-
- /* clean up a bit */
- hasmail = 0;
- dropenvelope(CurEnv);
- CurEnv = newenvelope(CurEnv);
- CurEnv->e_flags = BlankEnvelope.e_flags;
- break;
-
- case CMDRSET: /* rset -- reset state */
- message("250", "Reset state");
- if (InChild)
- finis();
- break;
-
- case CMDVRFY: /* vrfy -- verify address */
- if (runinchild("SMTP-VRFY") > 0)
- break;
- setproctitle("%s: %s", CurHostName, inp);
- vrfyqueue = NULL;
- QuickAbort = TRUE;
- sendtolist(p, (ADDRESS *) NULL, &vrfyqueue);
- if (Errors != 0)
- {
- if (InChild)
- finis();
- break;
- }
- while (vrfyqueue != NULL)
- {
- register ADDRESS *a = vrfyqueue->q_next;
- char *code;
-
- while (a != NULL && bitset(QDONTSEND|QBADADDR, a->q_flags))
- a = a->q_next;
-
- if (!bitset(QDONTSEND|QBADADDR, vrfyqueue->q_flags))
- {
- if (a != NULL)
- code = "250-";
- else
- code = "250";
- if (vrfyqueue->q_fullname == NULL)
- message(code, "<%s>", vrfyqueue->q_paddr);
- else
- message(code, "%s <%s>",
- vrfyqueue->q_fullname, vrfyqueue->q_paddr);
- }
- else if (a == NULL)
- message("554", "Self destructive alias loop");
- vrfyqueue = a;
- }
- if (InChild)
- finis();
- break;
-
- case CMDHELP: /* help -- give user info */
- if (*p == '\0')
- p = "SMTP";
- help(p);
- break;
-
- case CMDNOOP: /* noop -- do nothing */
- message("200", "OK");
- break;
-
- case CMDQUIT: /* quit -- leave mail */
- message("221", "%s closing connection", MyHostName);
- if (InChild)
- ExitStat = EX_QUIT;
- finis();
-
- case CMDVERB: /* set verbose mode */
- Verbose = TRUE;
- SendMode = SM_DELIVER;
- message("200", "Verbose mode");
- break;
-
- case CMDONEX: /* doing one transaction only */
- OneXact = TRUE;
- message("200", "Only one transaction");
- break;
-
- # ifdef SMTPDEBUG
- case CMDDBGQSHOW: /* show queues */
- printf("Send Queue=");
- printaddr(CurEnv->e_sendqueue, TRUE);
- break;
-
- case CMDDBGDEBUG: /* set debug mode */
- tTsetup(tTdvect, sizeof tTdvect, "0-99.1");
- tTflag(p);
- message("200", "Debug set");
- break;
-
- # else /* not SMTPDEBUG */
-
- case CMDDBGQSHOW: /* show queues */
- case CMDDBGDEBUG: /* set debug mode */
- # ifdef LOG
- if (RealHostName != NULL && LogLevel > 0)
- syslog(LOG_NOTICE,
- "\"%s\" command from %s (%s)\n",
- c->cmdname, RealHostName,
- inet_ntoa(RealHostAddr.sin_addr));
- # endif
- /* FALL THROUGH */
- # endif /* SMTPDEBUG */
-
- case CMDERROR: /* unknown command */
- message("500", "Command unrecognized");
- break;
-
- default:
- errno = 0;
- syserr("smtp: unknown code %d", c->cmdcode);
- break;
- }
- }
- }
- /*
- ** SKIPWORD -- skip a fixed word.
- **
- ** Parameters:
- ** p -- place to start looking.
- ** w -- word to skip.
- **
- ** Returns:
- ** p following w.
- ** NULL on error.
- **
- ** Side Effects:
- ** clobbers the p data area.
- */
-
- static char *
- skipword(p, w)
- register char *p;
- char *w;
- {
- register char *q;
-
- /* find beginning of word */
- while (isspace(*p))
- p++;
- q = p;
-
- /* find end of word */
- while (*p != '\0' && *p != ':' && !isspace(*p))
- p++;
- while (isspace(*p))
- *p++ = '\0';
- if (*p != ':')
- {
- syntax:
- message("501", "Syntax error");
- Errors++;
- return (NULL);
- }
- *p++ = '\0';
- while (isspace(*p))
- p++;
-
- /* see if the input word matches desired word */
- if (strcasecmp(q, w))
- goto syntax;
-
- return (p);
- }
- /*
- ** HELP -- implement the HELP command.
- **
- ** Parameters:
- ** topic -- the topic we want help for.
- **
- ** Returns:
- ** none.
- **
- ** Side Effects:
- ** outputs the help file to message output.
- */
-
- help(topic)
- char *topic;
- {
- register FILE *hf;
- int len;
- char buf[MAXLINE];
- bool noinfo;
-
- if (HelpFile == NULL || (hf = fopen(HelpFile, "r")) == NULL)
- {
- /* no help */
- errno = 0;
- message("502", "HELP not implemented");
- return;
- }
-
- len = strlen(topic);
- makelower(topic);
- noinfo = TRUE;
-
- while (fgets(buf, sizeof buf, hf) != NULL)
- {
- if (strncmp(buf, topic, len) == 0)
- {
- register char *p;
-
- p = index(buf, '\t');
- if (p == NULL)
- p = buf;
- else
- p++;
- fixcrlf(p, TRUE);
- message("214-", p);
- noinfo = FALSE;
- }
- }
-
- if (noinfo)
- message("504", "HELP topic unknown");
- else
- message("214", "End of HELP info");
- (void) fclose(hf);
- }
- /*
- ** RUNINCHILD -- return twice -- once in the child, then in the parent again
- **
- ** Parameters:
- ** label -- a string used in error messages
- **
- ** Returns:
- ** zero in the child
- ** one in the parent
- **
- ** Side Effects:
- ** none.
- */
-
- runinchild(label)
- char *label;
- {
- int childpid;
-
- if (!OneXact)
- {
- childpid = dofork();
- if (childpid < 0)
- {
- syserr("%s: cannot fork", label);
- return (1);
- }
- if (childpid > 0)
- {
- auto int st;
-
- /* parent -- wait for child to complete */
- st = waitfor(childpid);
- if (st == -1)
- syserr("%s: lost child", label);
-
- /* if we exited on a QUIT command, complete the process */
- if (st == (EX_QUIT << 8))
- finis();
-
- return (1);
- }
- else
- {
- /* child */
- InChild = TRUE;
- QuickAbort = FALSE;
- clearenvelope(CurEnv, FALSE);
- }
- }
-
- /* open alias database */
- initaliases(AliasFile, FALSE);
-
- return (0);
- }
-
- # endif SMTP
- @
-
-
- 5.28.0.1
- log
- @IDA patches
- @
- text
- @a68 1
- # define CMDTICK 12 /* tick -- batch SMTP sync command */
- d70 2
- a71 2
- # define CMDDBGQSHOW 13 /* showq -- show send queue */
- # define CMDDBGDEBUG 14 /* debug -- set debug mode */
- a86 1
- "tick", CMDTICK,
- d101 1
- a101 2
- smtp(batched)
- bool batched; /* running non-interactively? */
- a103 1
- int la;
- a111 1
- char TickArg[20];
- a113 1
- char hostbuf[MAXNAME]; /* for host name transformations */
- a136 7
-
- /* see if we are rejecting connections (see daemon.c) */
- la = getla();
- if (batched && la > RefuseLA) {
- message("421", "%s too busy, try again later", MyHostName);
- exit (EX_TEMPFAIL);
- }
- d198 1
- a198 5
-
- /* find canonical name */
- strcpy(hostbuf, p);
- maphostname(hostbuf, sizeof(hostbuf));
- if (!strcasecmp(hostbuf, MyHostName))
- d207 1
- a207 1
- if (RealHostName != NULL && strcasecmp(hostbuf, RealHostName))
- d209 2
- a212 2
- message("250", "Hello %s, why do you call yourself %s?",
- RealHostName, p);
- a214 1
- {
- d216 2
- a217 2
- message("250", "Hello %s, pleased to meet you", p);
- }
- a242 1
- define('r', "SMTP", CurEnv);
- d269 1
- a269 2
- if (!batched)
- CurEnv->e_flags &= ~EF_FATALERRS;
- d300 1
- a300 4
- message("503", "Need valid MAIL command");
- if (batched)
- Errors++;
- else
- d305 1
- a305 4
- message("503", "Need valid RCPT (recipient)");
- if (batched)
- Errors++;
- else
- d336 1
- a336 1
- if (CurEnv->e_nrcpts != 1 || batched)
- d341 2
- a342 5
- if (!batched) {
- CurEnv->e_flags &= ~EF_FATALERRS;
- CurEnv->e_xfp = freopen(queuename(CurEnv, 'x'),
- "w", CurEnv->e_xfp);
- }
- a441 5
- case CMDTICK: /* BSMTP TICK */
- (void) strncpy(TickArg, p, 20-1);
- message("250", "OK");
- break;
-
- d636 1
- a636 1
- initaliases(FALSE);
- @
-
-
- 5.28.0.2
- log
- @Fixed skipword() declaration. Moved #include "sendmail" to avoid SIGCLD
- re-declaration warning when #define SYSTEM5 is set in conf.h. Fixed
- fencepost bug in third expand() argument.
- @
- text
- @d21 1
- a21 3
- #include <errno.h>
- #include <signal.h>
- #include "sendmail.h"
- d31 3
- d110 1
- a110 1
- static char *skipword();
- d150 1
- a150 1
- expand("\001e", inp, &inp[(sizeof(inp) - 1)], CurEnv);
- a503 1
- syslog(LOG_NOTICE, "\"%s\" command unrecognized\n", cmdbuf);
- @
-
-
- 5.28.0.3
- log
- @Added missing #ifdef LOG, #endif around syslog() call.
- @
- text
- @d26 1
- a26 1
- # ifdef SMTP
- d28 1
- a28 1
- # else /* !SMTP */
- d30 1
- a30 1
- #endif /* SMTP */
- d33 1
- a33 1
- #ifdef SMTP
- d100 1
- a100 1
- # define EX_QUIT 22 /* special code for QUIT command */
- d491 1
- a491 1
- # ifdef LOG
- d497 1
- a497 1
- # endif /* LOG */
- a502 1
- # ifdef LOG
- a503 1
- # endif /* LOG */
- d675 1
- a675 1
- #endif SMTP
- @
-
-
- 5.28.0.4
- log
- @Trivial fix from neil Rickert (rickert@@cs.niu.edu).
- @
- text
- @d260 1
- @
-
-
- 5.28.0.5
- log
- @Commented out tokens following #endif statements. Fixed forward declaration
- of skipword. Deleted un-used assignment.
- @
- text
- @d30 1
- a30 1
- # endif /* SMTP */
- a98 1
- char *skipword();
- d109 1
- d188 1
- a511 1
- /* NOTREACHED */
- d676 1
- a676 1
- #endif /* SMTP */
- @
-
-
- 5.28.0.6
- log
- @Deleted #include <sys/types.h> as it's already included via sendmail.h from
- useful.h. #include "sendmail.h" relocated to top of #include list.
- @
- text
- @a20 1
- #include "sendmail.h"
- d23 1
- @
-
-
- 5.28.0.7
- log
- @Added static keyword to declaration of help() and runinchild().
- @
- text
- @a122 1
- static help(), runinchild();
- a575 1
- static
- a632 1
- static
- @
-
-
- 5.28.0.8
- log
- @ANSIfied.
- @
- text
- @a34 10
- #ifdef __STDC__
- static char * skipword(char *, const char *);
- static void help(char *);
- static runinchild(const char *);
- #else /* !__STDC__ */
- static char * skipword();
- static void help();
- static runinchild();
- #endif /* __STDC__ */
-
- d99 1
- a102 1
- void
- d119 2
- d122 2
- d533 1
- a533 1
- const char *w;
- d577 1
- a577 1
- static void
- d637 1
- a637 1
- const char *label;
- a643 2
- if (childpid > 0 && tTd(4, 2))
- printf("runinchild: forking (pid = %d)\n", childpid);
- @
-
-
- 5.28.0.9
- log
- @HELP with no arguments would sometimes cause a core dump. Depending
- on the compiler, constant strings are placed in read-only memory.
- HELP with no arguments attempts to makelower() a constant string in
- place. The fix is to use newstr()/free() within the help() routine.
- Reported by Steve Davies srd@@peora.sdc.ccur.com.
- @
- text
- @a599 1
- topic = newstr(topic);
- a624 1
- free(topic);
- @
-
-
- 5.28.0.10
- log
- @Include <sys/signal.h>, not <signal.h>.
- @
- text
- @d23 1
- a23 1
- #include <sys/signal.h>
- @
-
-
- 5.28.0.11
- log
- @Added RCS ID string
- @
- text
- @a27 1
- static char rcsid[] = "@@(#)$Id$ (with SMTP)";
- a29 1
- static char rcsid[] = "@@(#)$Id$ (without SMTP)";
- @
-
-
- 5.28.0.12
- log
- @System 5 and general improvement patches contributed by Bruce Lilly
- (bruce%balilly@@broadcast.sony.com).
- @
- text
- @d27 2
- a28 2
- static char sccsid[] = "@@(#)srvrsmtp.c 5.28 (Berkeley) 6/1/90 (with SMTP) %I% local";
- static char rcsid[] = "@@(#)$Id: srvrsmtp.c,v 5.28.0.11 1991/04/05 14:55:15 paul Exp paul $ (with SMTP)";
- d30 2
- a31 2
- static char sccsid[] = "@@(#)srvrsmtp.c 5.28 (Berkeley) 6/1/90 (without SMTP) %I% local";
- static char rcsid[] = "@@(#)$Id: srvrsmtp.c,v 5.28.0.11 1991/04/05 14:55:15 paul Exp paul $ (without SMTP)";
- d40 1
- a40 1
- static int runinchild(const char *);
- d44 1
- a44 1
- static int runinchild();
- d129 1
- d154 1
- a154 2
- if (batched && la > RefuseLA)
- {
- d159 1
- a159 1
- message("220", "%s", inp);
- d373 1
- a373 2
- if (!batched)
- {
- d619 1
- a619 1
- message("214-", "%s", p);
- d645 1
- a645 1
- static int
- @
-
-
- 5.28.0.13
- log
- @Save given host name if it differs from the looked up host name.
- @
- text
- @d28 1
- a28 1
- static char rcsid[] = "@@(#)$Id: srvrsmtp.c,v 5.28.0.16 1991/06/03 22:57:41 paul Exp paul $ (with SMTP)";
- d31 1
- a31 1
- static char rcsid[] = "@@(#)$Id: srvrsmtp.c,v 5.28.0.16 1991/06/03 22:57:41 paul Exp paul $ (without SMTP)";
- d125 1
- a125 1
- char *sendinghost = NULL;
- a129 1
- char *q;
- d161 1
- a161 1
- DeclHostName = NULL;
- d220 2
- a221 2
- (void) strcpy(hostbuf, p);
- (void) maphostname(hostbuf, sizeof(hostbuf));
- d234 1
- a234 1
- DeclHostName = newstr(hostbuf);
- a249 3
- {
- if (sendinghost)
- free(sendinghost);
- a250 1
- }
- d521 1
- a522 1
- /* NOTREACHED */
- a685 1
- #if !defined(DBM_AUTOBUILD) || ( !defined(NDBM) && !defined(OTHERDBM) )
- a687 1
- #endif /* !DBM_AUTOBUILD || (!NDBM && !OTHERDBM) */
- @
-
-
- 5.28.0.14
- log
- @Fix use of RealHostName.
- @
- text
- @d28 1
- a28 1
- static char rcsid[] = "@@(#)$Id: srvrsmtp.c,v 5.28.0.13 1991/06/06 19:50:49 paul Exp paul $ (with SMTP)";
- d31 1
- a31 1
- static char rcsid[] = "@@(#)$Id: srvrsmtp.c,v 5.28.0.13 1991/06/06 19:50:49 paul Exp paul $ (without SMTP)";
- d254 1
- a254 1
- sendinghost = newstr(RealHostName);
- @
-
-
- 5.28.0.15
- log
- @Changes for setjmp/longjmp optimization.
- @
- text
- @d27 2
- a28 2
- static char sccsid[] = "@@(#)srvrsmtp.c 5.28 (Berkeley) 6/1/90 (with SMTP)";
- static char rcsid[] = "@@(#)$Id: srvrsmtp.c,v 5.28.0.14 1991/06/13 20:18:34 paul Exp paul $ (with SMTP)";
- d30 2
- a31 2
- static char sccsid[] = "@@(#)srvrsmtp.c 5.28 (Berkeley) 6/1/90 (without SMTP)";
- static char rcsid[] = "@@(#)$Id: srvrsmtp.c,v 5.28.0.14 1991/06/13 20:18:34 paul Exp paul $ (without SMTP)";
- a113 4
- static bool hasmail; /* mail command received */
- static char *sendinghost;
- static char *ptr;
-
- d118 1
- d122 1
- d125 1
- d129 2
- a133 1
- sendinghost = NULL;
- d177 1
- a177 1
- ptr = sfgets(inp, sizeof inp, InChannel);
- d180 1
- a180 1
- if (ptr == NULL)
- d196 1
- a196 1
- for (ptr = inp; isspace(*ptr); ptr++)
- d198 2
- a199 2
- for (cmd = cmdbuf; *ptr != '\0' && !isspace(*ptr); )
- *cmd++ = *ptr++;
- d203 2
- a204 2
- while (isspace(*ptr))
- ptr++;
- d221 3
- a223 1
- if (!strcmp(ptr, MyHostName))
- d232 1
- a232 1
- if (RealHostName != NULL && strcasecmp(ptr, RealHostName))
- d234 1
- a234 3
- char hostbuf[MAXNAME];
-
- (void) sprintf(hostbuf, "%s (%s)", ptr, RealHostName);
- d237 1
- a237 1
- RealHostName, ptr);
- d241 2
- a242 2
- sendinghost = newstr(ptr);
- message("250", "Hello %s, pleased to meet you", ptr);
- d280 2
- a281 2
- ptr = skipword(ptr, "from");
- if (ptr == NULL)
- d283 1
- a283 1
- setsender(ptr);
- d304 2
- a305 2
- ptr = skipword(ptr, "to");
- if (ptr == NULL)
- d307 1
- a307 1
- a = parseaddr(ptr, (ADDRESS *) NULL, 1, '\0');
- d316 1
- a316 1
- CurEnv->e_to = ptr;
- d421 1
- a421 1
- sendtolist(ptr, (ADDRESS *) NULL, &vrfyqueue);
- d457 3
- a459 3
- if (*ptr == '\0')
- ptr = "SMTP";
- help(ptr);
- d484 1
- a484 1
- (void) strncpy(TickArg, ptr, 20-1);
- d496 1
- a496 1
- tTflag(ptr);
- @
-